import numpy as np

# arg求索引
x = np.random.normal(0, 1, size=100000)
print(np.min(x))
print(np.argmin(x))

# 排序
x = np.arange(16)
np.random.shuffle(x)
print(x)
x1 = np.sort(x)
print(np.argsort(x))
print(x1)
print(x)
# 原地排序，无须另赋新值
x.sort()
print(x)

# 矩阵的排序
y = np.random.randint(10, size=(4, 4))
print(y)
# 将每一行排序
print(np.sort(y))
print(np.sort(y, axis=0))